import {Component, Input, OnInit, ViewChild} from '@angular/core';
import {_HttpClient, ModalHelper} from '@delon/theme';
import {STColumn, STComponent} from '@delon/abc';

@Component({
  selector: 'app-act-model-task',
  templateUrl: './task.component.html',
})
export class ActModelTaskComponent implements OnInit {
  @Input()
  record: any = {};
  url = `act/modeler/flowElementList`;
  @ViewChild('st', { static: false }) st: STComponent;
  columns: STColumn[] = [
    { title: 'ID', index: 'id' },
    { title: '名称', index: 'name' },
    { title: 'pc表单',  index: 'callNo' },
    { title: '移动表单', index: 'avatar' },
    { title: '处理时间', index: 'dueDate' },
    {
      title: '操作',
      buttons: [
        // { text: '查看', click: (item: any) => `/form/${item.id}` },
        // { text: '编辑', type: 'static', component: FormEditComponent, click: 'reload' },
      ]
    }
  ];

  constructor(private http: _HttpClient, private modal: ModalHelper) { }

  ngOnInit() {
    console.log(this.record);
    this.url=this.url+`?id=${this.record.deploymentId}`
  }

  add() {
    // this.modal
    //   .createStatic(FormEditComponent, { i: { id: 0 } })
    //   .subscribe(() => this.st.reload());
  }

}
